package com.hex.ds.em.hcdp.pack.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @author : ky.zhang
 * @description :
 * @createDate : 2024/8/28 3:35
 */
@Data
@Entity
@Table(name = "Script_FIle_Status")
@Accessors(chain = true)
public class ScriptFileStatusEntity {
    @Id
    private String id;

    @Column(name = "file_name")
    private String fileName;

    @Column(name = "status")
    private String status;

    @Column(name = "scan_type")
    private String scanType;

    @Column(name = "scan_desc_info")
    private String scanDescInfo;

    @Column(name = "hand_comment")
    private String handComment;

    @Column(nullable = false)
    private Boolean deleted = false;

    @Column(name = "created_at", updatable = false)
    private Timestamp createdAt;

    @Column(name = "updated_at")
    private Timestamp updatedAt;

    @PrePersist
    protected void onCreate() {
        createdAt = new Timestamp(System.currentTimeMillis());
        updatedAt = new Timestamp(System.currentTimeMillis());
    }

    @PreUpdate
    protected void onUpdate() {
        updatedAt = new Timestamp(System.currentTimeMillis());
    }
}
